package com.example.doctorstation.POJOMapper;
import java.util.List;
import com.example.doctorstation.POJOData.*;
import org.apache.ibatis.annotations.*;
@Mapper
public interface PatientDiagnoseMapper {
    //获取诊断
    @Select("call getPatientDiagnose(#{arg0})")
    public List<PatientDiagnose> getPatientDiagnose(Integer patientID);


    //新增诊断
    @Insert("insert into p_patient_diagnose(PDIAGNOSE_CODE,PDIAGNOSE_NAME,PDESC,PSTATUS,PDIAGNOSE_DOCTOR_ID,PDIAGNOSE_DOCTOR_NAME,INHOSPITALINFOID,PATIENTID) " +
            "values (#{PDIAGNOSE_CODE},#{PDIAGNOSE_NAME},#{PDESC},#{PSTATUS},#{PDIAGNOSE_DOCTOR_ID},#{PDIAGNOSE_DOCTOR_NAME},#{INHOSPITALINFOID},#{PATIENTID})")
    public Integer addPatientDiagnose(PatientDiagnose diagnose);

    //诊断审核
    @Select("call updatePatientDiagnoseStatus(#{arg0})")
    public Integer updatePatientDiagnoseStatus(Integer PDIAGNOSE_ID);

    //查看此住院号包含的医嘱数量
    @Select("select count(PDIAGNOSE_ID) from p_patient_diagnose where INHOSPITALINFOID = #{arg0};")
    public Integer getPatientDiagnoseCount(Integer INHOSPITALINFOID);
}
